package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysDict;
import com.bohua.intermediary.service.SysDictService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysDict")
public class SysDictController {
    @Resource
    private SysDictService sysDictService;

    @RequestMapping
    public String sysDict(){
        return "sysDict/sysDict";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysDict/addSysDict";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysDict/updateSysDict";
    }

    @RequestMapping("/getSysDicts")
    @ResponseBody
    public Lay getSysDicts(SysDict sysDict,Integer page,Integer limit){
        return sysDictService.getSysDicts(sysDict,page,limit);
    }
    @RequestMapping("/addSysDict")
    @ResponseBody
    public Msg addSysDict(SysDict sysDict){
        return sysDictService.addSysDict(sysDict);
    }

    @RequestMapping("/updateSysDict")
    @ResponseBody
    public Msg updateSysDict(SysDict sysDict){
        return sysDictService.updateSysDict(sysDict);
    }

    @RequestMapping("/delSysDict")
    @ResponseBody
    public Msg delSysDict(SysDict sysDict){
        return sysDictService.delSysDict(sysDict);
    }
}
